﻿<%@ Page Title="Página principal" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="ChatSignalR._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
  <script src="http://code.jquery.com/jquery-1.7.min.js" type="text/javascript"></script>
  <script src="Scripts/jquery.signalR-0.5.0.min.js" type="text/javascript"></script>
  <script type="text/javascript">
      $(function () {
          var connection = $.connection('/echo');

          connection.received(function (data) {
              $('#messages').append('<li>' + data + '</li>');
          });

          connection.start();

          $("#broadcast").click(function () {
              connection.send($('#msg').val());
          });
      });
  </script>

  <input type="text" id="msg" />
  <input type="button" id="broadcast" value="broadcast" />

  <ul id="messages">
  </ul>
</asp:Content>
